package com.lgywin.runserver.comm;

import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtils {
    public static Date sub(Date curDate, int time)
    {
        long ms = curDate.getTime() - time;
        Date prevDay = new Date(ms);
        return prevDay;
    }

    public static void main(String[] args) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
        Date curDate = new Date();
        System.out.println(sdf.format(curDate));
        Date date = sub(curDate,Global.RegTimeLimit);

        System.out.println(sdf.format(date));
    }
}
